Skip to content

Comments

generate culled and non-culled variants of translucent textures#12

Open
illwieckz wants to merge 1 commit intomasterfrom
illwieckz/cull
Open

generate culled and non-culled variants of translucent textures#12
illwieckz wants to merge 1 commit intomasterfrom
illwieckz/cull

Conversation

@illwieckz
Copy link
Member

@illwieckz illwieckz commented Feb 20, 2026

Generate culled and non-culled variants of translucent textures.

A known way to workaround broken deluxe maps on translucent textures is to cull the translucent texture.

For example culling the trak5 glass workarounds this bug:

Sloth disabled culling on translucent textures, and it makes sense when the texture is within the world, like when used on a glass door, or that you can walk both outside and inside a building having windows made of glass.

But when the glass surface is sealing the world and the other side of the glass is the void, we can cull those textures, and it happens that culling such textures helps q3map2 to not do garbage with deluxe mapping (maybe q3map2 is trying to blend the deluxemaps of both side into one).

So this code generates an extra _cull variant, here an example with trak5 glass:

textures/shared_trak5/glass
{
	qer_editorImage textures/shared_trak5_src/glass_d
	qer_trans 0.50

	cull                none
	surfaceparm         trans

	{
		diffuseMap textures/shared_trak5_src/glass_d
		blend blend
	}
}

textures/shared_trak5/glass_cull
{
	qer_editorImage textures/shared_trak5_src/glass_d
	qer_trans 0.50

	surfaceparm         trans

	{
		diffuseMap textures/shared_trak5_src/glass_d
		blend blend
	}
}


newShader = copy.deepcopy(shader)
newShader["keywords"]["cull"] = {"none"}
newShaders[shadername + "_cull"] = newShader
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems backwards, the one named "cull" is the version with "no culling"?

Maybe "onesided"/"twosided" would be a clearer terminology.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes. It's backward. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants